const { err } = require('../helper/util');

module.exports = option => async (ctx, next) => {
  try {
    await next();
  } catch(e) {
    ctx.body = err(e.message);
  }
}